package com.java.laixiangdong.express.bean;

import java.io.Serializable;
import java.util.Objects;

/**
 * 快递位置信息类
 */
public class ExpressPlace implements Serializable {
    private int m;
    private int n;

    public int getM() {
        return m;
    }

    public void setM(int m) {
        this.m = m;
    }

    public int getN() {
        return n;
    }

    public void setN(int n) {
        this.n = n;
    }

    public ExpressPlace() {
    }

    public ExpressPlace(int m, int n) {
        this.m = m;
        this.n = n;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ExpressPlace that = (ExpressPlace) o;
        return getM() == that.getM() &&
                getN() == that.getN();
    }

    @Override
    public int hashCode() {
        return Objects.hash(getM(), getN());
    }

    @Override
    public String toString() {
        return "快递在第" + (m + 1) + "行，第" + (n + 1) + '列';
    }
}
